<?php

/**
 * EmpresaEgresos form.
 *
 * @package    cronos-doctrine
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class EmpresaEgresosForm extends BaseEmpresaEgresosForm
{
  public function configure()
  {
      
       unset (
        $this['created_at'],
        $this['updated_at']
      );
      
      $this->widgetSchema['empresa_id'] = new sfWidgetFormInputHidden(array(),array('value'=> sfContext::getInstance()->getUser()->getAttribute('agente_user_empresa_id')));
      $this->widgetSchema['numero_factura'] = new sfWidgetFormInputText(array(),array('placeholder'=>'Numero factura', 'style'=>'width:150px;'));
      $this->widgetSchema['fecha'] = new sfWidgetFormInput(array(), array('size' => 15, 'id' => 'fechaDashboard', 'readonly'=>'readonly', 'value' => date('Y-m-d')));
      
      
      $this->widgetSchema['descripcion'] = new sfWidgetFormTextarea(array(),array('rows'=> '3','style' =>'width:100%'));
      
      for($i =1;$i<=20; $i++) $array[$i] = $i;
      
      
      $this->widgetSchema['cantidad'] = new sfWidgetFormChoice(array(
         'choices' => $array,
         'expanded' => false,
         'multiple' => false,

      ));

      $categoria = new Categoria();
      $this->widgetSchema['categoria_id'] = new sfWidgetFormDoctrineChoice(array(
                      'model'     => 'Categoria',
                      'key_method'=>'getId',
                      'query'    => $categoria->getCategoriaPadre(0)
                      
            ));
      
      $camioneta = new Camioneta();
      $this->widgetSchema['camioneta_id'] = new sfWidgetFormDoctrineChoice(array(
                      'model'     => 'Camioneta',
                      'key_method'=>'getId',
                      'query'    => $camioneta->getCamionetaActivas(),
                      'add_empty' => 'Unidad'
            ));
      
      
      
      $this->widgetSchema['precio'] = new sfWidgetFormInput(array(), array('size' => 7,'style' => 'text-align: right'));
      
  } 
}